<%@page language="java" pageEncoding="utf-8"%>
<%@page import="java.io.*"%>
<%@page import="java.util.*"%>
<%@page import="java.sql.*"%>
<%@page import="com.ibatis.sqlmap.client.*"%>
<%@page import="com.ibatis.common.resources.*"%>
<%@page import="com.google.code.shapeline.core.*"%>
<%@page import="org.springframework.context.*"%>
<%@page import="org.springframework.web.context.support.*"%>
<%@page import="com.googlecode.shapeline.web.context.support.*"%>
<%@page import="com.googlecode.shapeline.core.*"%>
<%@page import="com.googlecode.shapeline.data.oswf.*"%>

<% 
ApplicationContext cxt = ApplicationContextUtils.getInstance().getApplicationContext();
SqlMapClient mapper = (SqlMapClient)cxt.getBean("sqlMapClient");

try {
	Adapter adapter = (Adapter)mapper.queryForObject("selectAdapterById", new Long(1));
	out.println(": " + adapter.getAdapterType().getName());
	
	List<Shape> shapes = adapter.getShapes();
	out.println("shapes: " + shapes.size());
	
	List<Adapter> adapters = shapes.get(0).getAdapters();
	out.println("adapters: " + adapters.get(0).getName());
	
	//Long id = new Long(1);
	//List stepList = mapper.queryForList("selectCurrentStepByEntry", id);
	//WorkflowStepData data = (WorkflowStepData)stepList.get(0);
	
	//out.println("count: " + data.getActionId());
	//mapper.startTransaction();
	
	//Map param = new HashMap();
	//param.put("globalKey", "osff_1");
	//param.put("itemKey", "caller");
	//List list = mapper.queryForList("selectProperty", param);
	//com.google.code.shapeline.data.oswf.PropertyData r = (com.google.code.shapeline.data.oswf.PropertyData)mapper.queryForObject("selectProperty", param);
	//out.println("value: " + list.get(0));
	
	//mapper.update("updateConfig(config)", c);
	
	//List list = mapper.queryForList("selectConfig(value)", "Africal");
	//out.println(", count: " + list.size());
	//c = (Config)list.get(0);
	//out.println(", value: " + c.getValue());
	
	//mapper.commitTransaction();
} catch (Exception e) {
	out.println("query error: " + e.getMessage());
} finally {
	//mapper.endTransaction();
}

%>
